import request from '@/utils/request'

/**
 * 获取所有角色列表信息
 * @param {*} params page pagesize
 * @returns promise
 */
export const GetAllRoleListAPI = (params) => {
  return request({
    method: 'GET',
    url: '/sys/role',
    params
  })
}

/**
 * 根据角色id删除角色
 * @param {*} id 角色id
 * @returns promise
 */
export const DelRoleByIdAPI = (id) => {
  return request({
    method: 'DELETE',
    url: '/sys/role/' + id
  })
}

/**
 * 根据id获取单个角色信息
 * @param {*} id
 * @returns promise
 */
export const GetTheRoleByIdAPI = (id) => {
  return request({
    method: 'GET',
    url: '/sys/role/' + id
  })
}

/**
 * 根据id编辑角色
 * @param {*} id
 * @returns
 */
export const EditTheRoleByIdAPI = (data) => {
  return request({
    method: 'PUT',
    url: '/sys/role/' + data.id,
    data
  })
}

/**
 * 新增角色
 * @param {*} data
 * @returns
 */
export const AddTheRoleByIdAPI = (data) => {
  return request({
    method: 'POST',
    url: '/sys/role/',
    data
  })
}

/**
 *根据id查询企业
 * @param {*} data
 * @returns
 */
export const GetCompanyInfoAPI = (id) => {
  return request({
    method: 'GET',
    url: '/company/' + id
  })
}
